package com.woniuxy02;

import java.util.ArrayList;
import java.util.List;

public class Test06 {
    public static void main(String[] args) {
        //班级：学生集合
        List<Student> class1 = new ArrayList<Student>();
        class1.add(new Student(1,"zs",11));
        class1.add(new Student(2,"ls",11));
        List<Student> class2 = new ArrayList<Student>();
        class2.add(new Student(3,"aa",11));
        class2.add(new Student(4,"bb",11));
        //学校:班级集合
        List<List<Student>> school=new ArrayList<List<Student>>();
        school.add(class1);
        school.add(class2);
        //遍历集合:
        for(List<Student> myclass:school){
            System.out.println("进入班级");
            for(Student student:myclass){
                System.out.println(student);
            }
        }

    }
}
